package com.sdlh.demo.guava;

import com.google.common.collect.ImmutableList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ImmutableListDemo {
    public static void main(String[] args) {
        User zak = new User("zak.z", 42);
        User fenix = new User("fenix.t", 44);
        ImmutableList<User> list = ImmutableList.of(zak, fenix);
        zak.setAge(43);
        log.info(list.toString());
    }
}

@Data
@NoArgsConstructor
@AllArgsConstructor
class User {
    String name;
    int age;
}
